<template>
  <view class="adm_content">
    <view class="head">
      <view class="title">
        {{info.title}}</view>
      <slot></slot>
    </view>
    <view class="content">
      <slot name="content">
      </slot>
      <view class="conItem" v-for="(item1,index1) in info.children"
        @click="Addskip(item1.url,item1.type)" :key="index1">
        <image :src="item1.img">
        </image>
        <view>{{item1.name}}
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  props: ['info'],
  methods: {
    Addskip(url, type) {
      if (type == 'switchTab') {
        const value = url.split('=')[1]
        uni.setStorageSync('switchId', value)
        uni.switchTab({
          url: url
        })
      } else {
        uni.navigateTo({
          url
        })
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.adm_content {
  width: 730rpx;
  // height: 298rpx;
  display: flex;
  flex-direction: column;
  // margin-bottom: 20rpx;
}

.head {
  display: flex;
  justify-content: space-between;
  height: 100rpx;
  align-items: center;
  font-size: 26rpx;
  padding: 0rpx 50rpx;
  position: relative;
  margin-bottom: 2rpx;
  background-color: #fff;

  .title {
    color: #333;
    font-weight: 600;
  }

  .title::before {
    display: inline-block;
    content: '';
    width: 10rpx;
    height: 50rpx;
    background-color: rgba(2, 167, 240, 1);
    position: absolute;
    left: 0rpx;
    top: 50%;
    transform: translateY(-50%);
  }
}

.content {
  display: flex;
  background-color: #fff;
  align-items: center;
  // height: 198rpx;
  padding: 20px 0 50rpx 0;
  .conItem {
    flex: 1;
    text-align: center;
    font-size: 24rpx;

    image {
      width: 90rpx;
      height: 84rpx;
    }
  }
}
</style>